//
//  THBaseTabBarController.m
//  M-Saler
//
//  Created by Teresa on 2020/5/26.
//  Copyright © 2020 Teresa. All rights reserved.
//

#import "THBaseTabBarController.h"

@interface THBaseTabBarController ()<UITabBarControllerDelegate,UITabBarDelegate>

@end

@implementation THBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.delegate = self;
}

-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
  
}

-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
    if (tabBarController.tabBar.selectedItem.tag != 1000 && [MHUserModel userModel].didLogin == NO) {
        MHLoginController *newVC = [MHLoginController new];
        newVC.modalPresentationStyle = UIModalPresentationFullScreen;
        [tabBarController presentViewController:newVC animated:YES completion:nil];
        return NO;
    }else{
        return YES;
    }
}

@end
